#{extends 'main.html' /}
#{set title:messages.get("yourdeals.text") /}
<div id="searchResults">
	<h2>&{'deals.found', deals.size()}</h2>
	#{list items:deals, as:'deal'}
    	<div class="searchResult">
    		<div class="dealThumbnail">
    			#{if deal.photo.get() != null}
    				<img class="searchResultsImage" src="@{dealPhoto(deal.id)}"/>
    			#{/if}
    		</div>
			<div class="dealTitle">
				<a href="@{Deals.viewDeal(deal.id)}">${deal.title}</a>
			</div>
			<div class="dealLocation">
				${deal.address.street} ${deal.address.houseNumber}, ${deal.address.city}
			</div>
			<div class="dealTimespan">
				&{'deal.valid.from.to.text', deal.startDate.format(), deal.endDate.format()}
			</div>
			<div class="daysRemaining">&{'days.remaining.text'}: <span>4</span></div>
			<div class="clear"></div>
		</div>
			
	#{/list}
	
</div>